<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class AdminFeedbackRecord extends Model
{
    //
    protected $autoWriteTimestamp = true;

    public function setScreenPicAttr($value)
    {
        return json_encode($value, JSON_UNESCAPED_UNICODE);
    }

    public function getScreenPicAttr($value)
    {
        return json_decode($value, true);
    }

    public static function getTypeList()
    {
        $res = cache('feed-back-type');
        if ($res) {
            return $res;
        }
        $list = (new self())->group('problem_type')->column('problem_type');
        cache('feed-back-type', $list);
        return $list;
    }
}
